﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace KZ400B
{

    public class OneStepAddtionState
    {
        string m_AxleName;
        public string AxleName
        {
            get { return m_AxleName; }
            set { m_AxleName = value; }
        }

        double m_Addtion;
        public double Addtion
        {
            get { return m_Addtion; }
            set { m_Addtion = value; }
        }

        
    }

    public class OneStepAddManager
    {
        static bool m_isR = false;
        static object m_isRlk = new object();

        public static bool IsRunning
        {
            get { lock (m_isRlk) { return OneStepAddManager.m_isR; } }
            set { lock (m_isRlk) { OneStepAddManager.m_isR = value; } }
        }

        static Thread m_tR = null;
        static void Start()
        {
            if (IsRunning) return;
            if (m_tR == null)
            {
                IsRunning = true;
                m_tR = new Thread(new ThreadStart(proc));
                m_tR.Start();
            }
        }

        static void Stop()
        {
            IsRunning = false;
            try
            {
                m_tR.Join();
                m_tR = null;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

        }

        static void proc()
        {
            while (IsRunning)
            { 
            
            }
        }
    }
}
